package com.cdivtc.management.service;


import com.cdivtc.management.pojo.Result;
import com.cdivtc.management.utils.JsonUtils;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Service
public class RequestServer {

//    统一发送错误请求
    public void SendReresponse(HttpServletResponse response, Result result) throws IOException {
        String s = JsonUtils.objectToJson(result);
        response.setCharacterEncoding("utf-8");
        response.setContentType("application/json; charset=utf-8");
        response.getWriter().println(s);


    }

}
